﻿(function ($) {
    var dataTable = $('#ProductTable').DataTable(abp.libs.datatables.normalizeConfiguration({
        ajax: abp.libs.datatables.createAjax(rechargeable.amazon.products.product.getList, inputAction),
        processing: true,
        serverSide: true,
        paging: true,
        searching: false,
        autoWidth: false,
        scrollCollapse: true,
        order: [[1, "asc"]],
        columnDefs: [
            { data: "asin" },
            { data: "name" },
            { data: "count" }
        ]
    }));


    $("#btnSearch").on("click", function () {
        console.log("搜索");
        dataTable.ajax.reload();
    });
})(jQuery);

function inputAction() {
    return {
        asin: $("#asin").val()
    };
}